<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 浅克隆
    /* var arr= [1,2,3];
    var arr2 = [...arr];
    arr2.push(4);
    console.log(arr); */
    var obj = {
      a: 10,
      b: 20
    }
    /* var obj2 = {
      ...obj
    } */
   /* var obj2 =  Object.assign({},obj)
   console.log(obj2);
   obj2.a = 1000;
   console.log(obj); */

  //  深克隆  递归 
  // JSON.parse(JSON.stringify(obj))
  // lodash
  </script>
</body>
</html>